package cc.momas.momall.portal.web;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import cc.momas.momall.po.TbContent;
import cc.momas.momall.service.IContentService;

@Controller
public class BaseController {
	
	@Value("${CONTENT_LUNBO_ID}")
	private Long CONTENT_LUNBO_ID;
	
	@Autowired
	private IContentService contentSvc;
	
	
	@RequestMapping(value="/index.html")
	public String toPage(Model model) {
		//查询内容列表
		List<TbContent> ad1List = contentSvc.getContentListByCid(CONTENT_LUNBO_ID);
		//把结果传递给页面
		model.addAttribute("ad1List", ad1List);
		return "index";
	}
	
}
